﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace ERPStore.Web.Services
{
	[ServiceContract(Name = "EmailTemplateService"
		, Namespace = "http://www.erpstore.net/2011/09/29")]
	public interface IEmailTemplateService
	{
		Models.EmailView CreateEmailView(string viewName, object model = null);

		ERPStore.Models.MailMessage CreateEmailMessage(Models.EmailView email);

		ERPStore.Models.MailMessage GetUserTemplate(string templateName, ERPStore.Models.User user, Dictionary<string, string> parameters);

		[OperationContract]
		ERPStore.Models.MailMessage GetOrderCartTemplate(string templateName, string code);

		[OperationContract]
		ERPStore.Models.MailMessage GetOrderTemplate(string templateName, string orderCode, Dictionary<string, string> parameters);

		[OperationContract]
		ERPStore.Models.MailMessage GetUserTemplate(string templateName, int userId, Dictionary<string, string> parameters);

		[OperationContract]
		ERPStore.Models.MailMessage GetTemplate(string templateName);

		ERPStore.Models.MailMessage GetTemplate(string template, object model);

		IDictionary<string, string> GetTemplateNameListByModel(string model);

        #region Edition

		[OperationContract]
		List<ERPStore.Models.EmailTemplate> GetTemplateList();

		[OperationContract]
		ERPStore.Models.EmailTemplate CreateCustomTemplate();

		[OperationContract]
		void DeleteTemplate(ERPStore.Models.EmailTemplate templateName);

		[OperationContract]
		void SaveTemplate(ERPStore.Models.EmailTemplate template);

        #endregion
    }
}
